home *** CD-ROM | disk | FTP | other *** search
- Path: osf1.gmu.edu!jscheibl
- From: jscheibl@osf1.gmu.edu (Jack W Scheible)
- Newsgroups: comp.software-eng,comp.unix.solaris,comp.unix.programmer,comp.windows.x,comp.windows.x.motif,comp.lang.c,comp.lang.c++,comp.lang.tcl,comp.object,comp.lang.fortran
- Subject: structures as formal parameters
- Date: 18 Feb 1996 01:56:18 GMT
- Organization: George Mason University, Fairfax, Virginia, USA
- Distribution: inet
- Message-ID: <4g6102$lql@portal.gmu.edu>
- References: <4fut4m$h5t@Dortmund.Germany.EU.net> <31267EED.4874066A@holisticmath.com>
- NNTP-Posting-Host: osf1.gmu.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
-
-
- I am trying to pass structures to subroutines. My problem is that,
- when I try to write the interface, it will not recognize previously
- declared types. I can put the type definition into the interface, but
- then it is not recognized outside the interface.
-
- PROGRAM JUNK
-
- TYPE CARTESIAN
- REAL*8 X
- REAL*8 Y
- END TYPE CARTESIAN
-
- INTERFACE
- SUBROUTINE CART_TO_POLAR ( XY, RTHETA )
- TYPE POLAR
- REAL*8 R
- REAL*8 THETA
- END TYPE POLAR
- TYPE (CARTESIAN), INTENT(IN) :: XY ! CARTESIAN Not Declared
- TYPE (POLAR), INTENT(OUT):: RTHETA ! Just fine
- END SUBROUTINE CART_TO_POLAR
- END INTERFACE
-
- TYPE (CARTESIAN) XY ! Just fine
- TYPE (POLAR) RTHETA ! POLAR Not Declared
-
- END
-
- Is there any way to use structures in an interface without declaring
- the structures twice?
-
- -jack
-